#!/usr/bin/env bash

cmd=$1
timeout=$2

set a=0

while true
do
    a=a+1
    eval $cmd
    pid=$!
    echo $pid
    sleep $timeout
    echo $a": times"
    kill -9 $pid
done